
#ifndef XDNS_SERVER_SELECTOR_IMPL_H
#define XDNS_SERVER_SELECTOR_IMPL_H

#include "xdns-server-selector.h"
#include "xdns-server-state-listener.h"
#include <vector>




// gupeng
/*
   1. Data structure std::vector<XdnsServerSelectorItem>
   binary insertion.
   2. Loop for release.
   3. Fail - choose the second one.
*/

class XdnsServerSelectorImpl : public XdnsServerSelector,
                               public XdnsServerStateListener
{
public:
    friend class XdnsServerSelector;

    /* See xdns-server-selector.h for description. */
    /* See xdns-server-state-listener.h for description. */

    // gupeng

private:
    XdnsServerSelectorImpl();
    virtual ~XdnsServerSelectorImpl();

    std::vector<XdnsServerStateInfo> m_statesInfo;
};

class XdnsServerStateInfo
{
public:
    /*! XdnsServerStateInfo constructor.

        @param state A pointer to a XdnsServerState object. This
                     function does not take ownership of this object.
    */
    XdnsServerStateInfo(XdnsServerState* state);
    // gupeng
    XdnsDataBlock(const XdnsDataBlock& anotherBlock);
    ~XdnsDataBlock();

    XdnsDataBlock& operator=(const XdnsDataBlock& anotherBlock);

    XdnsServerState* m_state;
    long succeededCount;
    long failedCount;
    long averageTime;


};
#endif  // XDNS_SERVER_STATE_IMPL_H

